The scripts in this directory solve KS model and generate the simulated data for Section 4:


/Auxiliary Functions/ contains subroutines used for Thomas Winberry’s solution method (Quantitative Economics, 2018). 
/Figures/ contains the folders where figures generated by the code will be saved 

1. steadyState.m: solve for the steady state of the model.

2. dynamics.m: solve for the first order approximation of the model’s dynamics.

Note) for more detailed explanation on steadyState.m, dynamics.m, and the associated subroutines, refer to Thomas Winberry's webpage at https://www.thomaswinberry.com/research/index.html

3. KS_Simulation.m: simulates the data from the solved KS model (Fig 2). ParaSel = 1 (perfect aggregation), ParaSel = 2 (imperfect aggregation). 

4. KS_PopulationIRF.m: generates the IRFs from the solved KS model (Fig 3). ParaSel = 1 (perfect aggregation), ParaSel = 2 (imperfect aggregation). 


